import request from '@/utils/request';

/**
 * 获取用户排行榜
 * @param params 值
 * @returns {AxiosPromise}
 */
export function getUserRankListApi(selectedId, params) {
  return request({
    url: `/api/InteractStatistics/${selectedId}`,
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
      Accept: 'application/json'
    },
    params: Object.assign(params)
  });
}
/**
 * 获取公司排行榜
 * @param params 值
 * @returns {AxiosPromise}
 */
export function getCompanyRankListApi(selectedId, params) {
  return request({
    url: `/api/InteractStatistics/${selectedId}/company`,
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
      Accept: 'application/json'
    },
    params: Object.assign(params)
  });
}

/**
 * 获取单个用户
 * @param params 值
 * @returns {AxiosPromise}
 */
export function getUserRankApi(selectedId, id) {
  return request({
    url: `/api/InteractStatistics/${selectedId}/${id}`,
    method: 'GET',
    headers: {
      Accept: 'application/json'
    },
  });
}

/**
 * 修改数量
 * @param userId
 * @param data
 * @returns {AxiosPromise}
 * @constructor
 */
export function putUserRankApi(selectedId, id, data) {
  return request({
    url: `/api/InteractStatistics/${selectedId}/${id}`,
    method: 'PUT',
    headers: {
      isToken: true
    },
    data: data
  })
}

/**
 * 批量删除用户
 * @param data 数据
 */
export function deleteUserAllApi(selectedId, params) {
  return request({
    url: `/api/InteractStatistics/${selectedId}`,
    method: 'DELETE',
    params: Object.assign(params)
  });
}